function home_ajax()
{

    $.post("home/json", {
        "nome": "nome",
        "email" : "email",
        "telefone" : "telefone",
        "site" : "site"
    },
    function(data){
        if(data.result == true)
        {
            $('#tabs-1').html("<p>Cadastrado com Sucesso</p>"); 
        }
        else
            alert('Erro ao cadastrar');
    }, 'json');
   
}

function carrega_view(controlador,action)
{
    if(controlador == '' && action == '')
    {
        controlador = 'home';
        action = 'home';
    }
    
    
    //$('.ui-state-default ui-corner-top ui-tabs-selected ui-state-active').html(controlador);
    $('#tabs-1').load('aplicacao/views/'+controlador+'/'+action+'.phtml');
}

function grid_usuario()
{
    jQuery('#customers').jqGrid({
       url: 'http://localhost/freeline/usuario/listar',
       dataType: 'xml',
       mtype: 'POST',
       colNames: ['ID #','Usuario'],
       colModel: [{
           name: 'id',index:'id',width:15, align:'center'},{
           name: 'usuario',index:'usuario',width:15, align:'center'}],
       pager: jQuery('#pg'),
       rowNum: 15,
       height: 225,
       width: 780,
       scrolloffset: 0,
       rowList: [1,5,10,15],
       sortname: 'AUHSUHASUHAS',
       sortorder: 'asc',
       voewrecords: true,
       caption: 'Teste'
    });
}